
  yy = "2011"
  mm = "05"
  sp = "BC"
  dd = "07" 

  load "loadit" 

;;......................................................................................
;; Data 
;;......................................................................................
  da = "../daily/"+yy+"/"  
  db = "../monthly/" 

  fna = da+"fraction_emissions_"+yy+mm+dd+".nc" 
  fnb = db+"emis_0.5x0.5_GFED3.1_"+yy+mm+"_"+sp+".nc"
  fno = "daily_"+sp+"_"+yy+mm+dd+".nc" 

;;......................................................................................
;; Read data 
;;......................................................................................
  print("read "+fna) 
  print("read "+fnb) 
 
  fla = addfile(fna,"r") 
  flb = addfile(fnb,"r") 

  fact = fla->Fraction_of_Emissions 
  emis = flb->$sp$

  printVarSummary(fact) 
  printVarSummary(emis) 

;;......................................................................................
;; Scaling 
;;......................................................................................
;; 
;; different latitude (so apply ::-1 in code) ### 
;; 
;; Variable: fact
;; Dimensions and sizes:   [lat | 360] x [lon | 720]
;; Coordinates:
;;             lat: [-89.75..89.75]
;;             lon: [-179.75..179.75]
;; 
;; 
;; Variable: emis
;; Dimensions and sizes:   [time | 1] x [lat | 360] x [lon | 720]
;; Coordinates:
;;             time: [ 0.. 0]
;;             lat: [89.75..-89.75]
;;             lon: [-179.75..179.75]


  emis(0,:,:) = emis(0,:,:) * fact(::-1,:) 

;;......................................................................................
;; Reset time 
;;......................................................................................
  emis&time@units = "days since "+yy+"-"+mm+"-"+dd+" 00:00:00" 

;;......................................................................................
;; Output data 
;;......................................................................................
  system("rm "+fno) 
 
  flo = addfile(fno,"c") 

  flo->$sp$=emis  


